<template>
  <el-dialog title="填写邀请链接" :visible.sync="visible" width="66%" @open="onOpen" :before-close="onCancel"
    :close-on-click-modal="false">
    <el-input type="textarea" :rows="12" placeholder="从游戏中拷贝邀请链接集中填写到这里
    一行一个链接
    示例：
    https://t.me/...
    https://t.me/...
    https://t.me/..." v-model="textContent">
    </el-input>
    <span slot="footer" class="dialog-footer">
      <el-button @click="onCancel">取 消</el-button>
      <el-button type="primary" @click="onConfirm">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>

export default {
  props: {
    visible: { type: Boolean, default: false },
    project: {
      type: Object,
      default: null,
    }
  },
  data() {
    return {
      formLabelWidth: '120px',
      textContent: "",
    }
  },
  mounted() {
  },
  methods: {
    onCancel() {
      this.$emit("on-dismiss")
    },
    async onConfirm() {
      this.$emit("on-dismiss", this.textContent)
    },
    onOpen() {
      if (this.project != null) {
        this.textContent = (this.project.inviteList ?? []).join("\n")
      } else {
        this.textContent = ""
      }
    },
  }
}
</script>



<style lang="scss" scoped>
.version-update {
  &-info {
    margin-left: 10px;
    margin-top: 10px;
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
  }

  &-footer {
    margin-right: 60px;
  }
}
</style>